<?php
namespace app\index\controller;
use think\Controller;
use think\Db;

class Index extends Controller
{	
    public function getCateinfo($pid){
        $res = Db::table('t_admin_cates')->where('pid',$pid)->select();
        $data=[];
        foreach ($res as $key => $value) {
            $value['shop']=$this->getCateinfo($value['id']);
            $data[]=$value;
        }
        return $data;

    }
	public function Index()
    {
        $cate = $this->getCateinfo(0);
        // P($cate);
        return $this->fetch('index/index',['cate'=>$cate]);
    }


    public function show(){
    	echo "string";
    }


}
